3.689 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx\)

Optimal. Leaf size=151 \[ \frac {a^3 (5 B+i A) (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac {4 a^3 (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (2 B+i A) (c-i c \tan (e+f x))^{n+1}}{c f (n+1)}-\frac {a^3 B (c-i c \tan (e+f x))^{n+3}}{c^3 f (n+3)} \]

[Out]

4*a^3*(I*A+B)*(c-I*c*tan(f*x+e))^n/f/n-4*a^3*(I*A+2*B)*(c-I*c*tan(f*x+e))^(1+n)/c/f/(1+n)+a^3*(I*A+5*B)*(c-I*c
*tan(f*x+e))^(2+n)/c^2/f/(2+n)-a^3*B*(c-I*c*tan(f*x+e))^(3+n)/c^3/f/(3+n)

________________________________________________________________________________________

Rubi [A]  time = 0.19, antiderivative size = 151, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3588, 77} \[ \frac {a^3 (5 B+i A) (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac {4 a^3 (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (2 B+i A) (c-i c \tan (e+f x))^{n+1}}{c f (n+1)}-\frac {a^3 B (c-i c \tan (e+f x))^{n+3}}{c^3 f (n+3)} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(4*a^3*(I*A + B)*(c - I*c*Tan[e + f*x])^n)/(f*n) - (4*a^3*(I*A + 2*B)*(c - I*c*Tan[e + f*x])^(1 + n))/(c*f*(1
+ n)) + (a^3*(I*A + 5*B)*(c - I*c*Tan[e + f*x])^(2 + n))/(c^2*f*(2 + n)) - (a^3*B*(c - I*c*Tan[e + f*x])^(3 +
n))/(c^3*f*(3 + n))

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx &=\frac {(a c) \operatorname {Subst}\left (\int (a+i a x)^2 (A+B x) (c-i c x)^{-1+n} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (4 a^2 (A-i B) (c-i c x)^{-1+n}-\frac {4 a^2 (A-2 i B) (c-i c x)^n}{c}+\frac {a^2 (A-5 i B) (c-i c x)^{1+n}}{c^2}+\frac {i a^2 B (c-i c x)^{2+n}}{c^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {4 a^3 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (i A+2 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {a^3 (i A+5 B) (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}-\frac {a^3 B (c-i c \tan (e+f x))^{3+n}}{c^3 f (3+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 13.77, size = 822, normalized size = 5.44 \[ \frac {\cos ^4(e+f x) \left (-\frac {i \sec (e) \left (B e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)-i B e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)\right ) \sin (f x) \sec ^3(e+f x)}{n+3}+\frac {\sec (e) (3 A \cos (e)-9 i B \cos (e)+A n \cos (e)-2 i B n \cos (e)+2 B \sin (e)+B n \sin (e)) \left (-i e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)-e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)\right ) \sec ^2(e+f x)}{(n+2) (n+3)}+\frac {\left (A n^2-i B n^2+6 A n-6 i B n+9 A-13 i B\right ) \sec (e) \left (2 i e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)-2 e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)\right ) \sin (f x) \sec (e+f x)}{(n+1) (n+2) (n+3)}+\frac {\sec (e) \left (i A \cos (e) n^3+B \cos (e) n^3-A \sin (e) n^3+i B \sin (e) n^3+6 i A \cos (e) n^2+6 B \cos (e) n^2-6 A \sin (e) n^2+6 i B \sin (e) n^2+13 i A \cos (e) n+9 B \cos (e) n-9 A \sin (e) n+13 i B \sin (e) n+12 i A \cos (e)+12 B \cos (e)\right ) \left (\frac {2 e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)}{n}-\frac {2 i e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)}{n}\right )}{(n+1) (n+2) (n+3)}\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-\frac {n (\log (c-i c \tan (e+f x))-\log (c \sec (e+f x)))}{\log (c-i c \tan (e+f x))}}}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(Cos[e + f*x]^4*((Sec[e]*Sec[e + f*x]^2*(3*A*Cos[e] - (9*I)*B*Cos[e] + A*n*Cos[e] - (2*I)*B*n*Cos[e] + 2*B*Sin
[e] + B*n*Sin[e])*((-I)*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3*e]
- E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e]))/((2 + n)*(3 + n)) +
(Sec[e]*((12*I)*A*Cos[e] + 12*B*Cos[e] + (13*I)*A*n*Cos[e] + 9*B*n*Cos[e] + (6*I)*A*n^2*Cos[e] + 6*B*n^2*Cos[e
] + I*A*n^3*Cos[e] + B*n^3*Cos[e] - 9*A*n*Sin[e] + (13*I)*B*n*Sin[e] - 6*A*n^2*Sin[e] + (6*I)*B*n^2*Sin[e] - A
*n^3*Sin[e] + I*B*n^3*Sin[e])*((2*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))
*Cos[3*e])/n - ((2*I)*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])/n
))/((1 + n)*(2 + n)*(3 + n)) + ((9*A - (13*I)*B + 6*A*n - (6*I)*B*n + A*n^2 - I*B*n^2)*Sec[e]*Sec[e + f*x]*(-2
*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3*e] + (2*I)*E^((-I)*f*n*x +
 n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])*Sin[f*x])/((1 + n)*(2 + n)*(3 + n)) -
(I*Sec[e]*Sec[e + f*x]^3*(B*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3
*e] - I*B*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])*Sin[f*x])/(3
+ n))*(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^(n - (n*(-Log[c*Sec[e + f*x]] + Log
[c - I*c*Tan[e + f*x]]))/Log[c - I*c*Tan[e + f*x]]))/(f*(Cos[f*x] + I*Sin[f*x])^3*(A*Cos[e + f*x] + B*Sin[e +
f*x]))

________________________________________________________________________________________

fricas [B]  time = 2.99, size = 332, normalized size = 2.20 \[ \frac {{\left ({\left (8 i \, A - 8 \, B\right )} a^{3} n + {\left (24 i \, A + 24 \, B\right )} a^{3} + {\left ({\left (4 i \, A + 4 \, B\right )} a^{3} n^{3} + {\left (24 i \, A + 24 \, B\right )} a^{3} n^{2} + {\left (44 i \, A + 44 \, B\right )} a^{3} n + {\left (24 i \, A + 24 \, B\right )} a^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left ({\left (4 i \, A - 4 \, B\right )} a^{3} n^{3} + {\left (32 i \, A - 8 \, B\right )} a^{3} n^{2} + {\left (84 i \, A + 36 \, B\right )} a^{3} n + {\left (72 i \, A + 72 \, B\right )} a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left ({\left (8 i \, A - 8 \, B\right )} a^{3} n^{2} + 48 i \, A a^{3} n + {\left (72 i \, A + 72 \, B\right )} a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n + {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="fricas")

[Out]

((8*I*A - 8*B)*a^3*n + (24*I*A + 24*B)*a^3 + ((4*I*A + 4*B)*a^3*n^3 + (24*I*A + 24*B)*a^3*n^2 + (44*I*A + 44*B
)*a^3*n + (24*I*A + 24*B)*a^3)*e^(6*I*f*x + 6*I*e) + ((4*I*A - 4*B)*a^3*n^3 + (32*I*A - 8*B)*a^3*n^2 + (84*I*A
 + 36*B)*a^3*n + (72*I*A + 72*B)*a^3)*e^(4*I*f*x + 4*I*e) + ((8*I*A - 8*B)*a^3*n^2 + 48*I*A*a^3*n + (72*I*A +
72*B)*a^3)*e^(2*I*f*x + 2*I*e))*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n/(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n + (f*n^4
 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(6*I*f*x + 6*I*e) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(4*I*f*x + 4*I*e
) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(2*I*f*x + 2*I*e))

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (f x + e\right ) + A\right )} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)*(I*a*tan(f*x + e) + a)^3*(-I*c*tan(f*x + e) + c)^n, x)

________________________________________________________________________________________

maple [C]  time = 4.62, size = 4339, normalized size = 28.74 \[ \text {output too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x)

[Out]

4*a^3/(3+n)/f/(exp(2*I*(f*x+e))+1)^3/(1+n)/(2+n)/n*(12*I*n*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(
I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*
c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*
c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(2*I*f*x)*exp(2*I*e)+2*I*n^2*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-
1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/
2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+
1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(2*I*f*x)*exp(2*I*e)+8*I*n^2*A*c^n/((exp(2*I*(f*x+e))+1)^n
)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*P
i*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*
I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+I*n^3*A*c^n/((exp(2*I*(f*x
+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*cs
gn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*
c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+11*I*n*A*c^n/((ex
p(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e)
)+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2
*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(6*I*e)+6*I*n^2
*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(
2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*
n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(6*I
*e)+21*I*n*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn
(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e
))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(4*I*f*
x)*exp(4*I*e)+I*n^3*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1
/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2
*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*e
xp(6*I*f*x)*exp(6*I*e)+6*I*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*Pi*n*(c
sgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))-2*n*B
*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*Pi*n*(csgn(I*c/(exp(2*I*(f*x+e))+1)
)-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+6*B*c^n/((exp(2*I*(f*x+e))+1)^n)*
2^n*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*Pi*n*(csgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1))
)*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+2*I*n*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(1/2*I*csgn(I*c/(ex
p(2*I*(f*x+e))+1))*Pi*n*(csgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x
+e))+1))+csgn(I*c)))-2*n^2*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n
)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I
/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*
Pi*n)*exp(2*I*f*x)*exp(2*I*e)-n^3*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))
^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2
*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e
))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+18*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e
))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))
+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*
(f*x+e))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+18*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*
(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f
*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(ex
p(2*I*(f*x+e))+1))*Pi*n)*exp(2*I*f*x)*exp(2*I*e)+6*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp
(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2
*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(
I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(6*I*e)-2*n^2*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn
(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I
*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I
*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+9*n*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2
*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I
*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))
*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+11*n*B*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*
exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*e
xp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x
+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(6*I*e)+n^3*B*c^n/((exp(2*I*(f*x+e))+1)^
n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*
Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2
*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(6*I*e)+6*n^2*B*c^n/((exp(2*I*(f*
x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*c
sgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*I*csgn(I
*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(6*I*e)+18*I*A*c^n/((exp
(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))
+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(-1/2*
I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(2*I*f*x)*exp(2*I*e)+18*I*A*c
^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*
(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*e
xp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(4*I*f*x)*exp(4*I*e)+
6*I*A*c^n/((exp(2*I*(f*x+e))+1)^n)*2^n*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*Pi*n)*exp(1/2*I*csgn(I*c/(e
xp(2*I*(f*x+e))+1))^2*csgn(I*c)*Pi*n)*exp(1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*
Pi*n)*exp(-1/2*I*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*Pi*n)*exp(6*I*f*x)*exp(
6*I*e))

________________________________________________________________________________________

maxima [B]  time = 1.21, size = 1057, normalized size = 7.00 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="maxima")

[Out]

(8*((A + I*B)*a^3*c^n*n^2 + 6*A*a^3*c^n*n + 9*(A - I*B)*a^3*c^n)*2^n*cos(-2*f*x + n*arctan2(sin(2*f*x + 2*e),
cos(2*f*x + 2*e) + 1) - 2*e) + 4*((A + I*B)*a^3*c^n*n^3 + 2*(4*A + I*B)*a^3*c^n*n^2 + 3*(7*A - 3*I*B)*a^3*c^n*
n + 18*(A - I*B)*a^3*c^n)*2^n*cos(-4*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e) + 4*((A -
I*B)*a^3*c^n*n^3 + 6*(A - I*B)*a^3*c^n*n^2 + 11*(A - I*B)*a^3*c^n*n + 6*(A - I*B)*a^3*c^n)*2^n*cos(-6*f*x + n*
arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 6*e) + 8*((A + I*B)*a^3*c^n*n + 3*(A - I*B)*a^3*c^n)*2^n*cos
(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + ((-8*I*A + 8*B)*a^3*c^n*n^2 - 48*I*A*a^3*c^n*n + (-72*I*
A - 72*B)*a^3*c^n)*2^n*sin(-2*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 2*e) + ((-4*I*A + 4*B)
*a^3*c^n*n^3 + (-32*I*A + 8*B)*a^3*c^n*n^2 + (-84*I*A - 36*B)*a^3*c^n*n + (-72*I*A - 72*B)*a^3*c^n)*2^n*sin(-4
*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e) + ((-4*I*A - 4*B)*a^3*c^n*n^3 + (-24*I*A - 24*
B)*a^3*c^n*n^2 + (-44*I*A - 44*B)*a^3*c^n*n + (-24*I*A - 24*B)*a^3*c^n)*2^n*sin(-6*f*x + n*arctan2(sin(2*f*x +
 2*e), cos(2*f*x + 2*e) + 1) - 6*e) + ((-8*I*A + 8*B)*a^3*c^n*n + (-24*I*A - 24*B)*a^3*c^n)*2^n*sin(n*arctan2(
sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)))/(((-I*n^4 - 6*I*n^3 - 11*I*n^2 - 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*
f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(6*f*x + 6*e) + (-3*I*n^4 - 18*I*n^3 - 33*I*n^2 - 18*I*n)*(c
os(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(4*f*x + 4*e) + (n^4 + 6*n^3 + 11*
n^2 + 6*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(6*f*x + 6*e) + 3*(n^
4 + 6*n^3 + 11*n^2 + 6*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(4*f*x
 + 4*e) + (-I*n^4 - 6*I*n^3 - 11*I*n^2 + (-3*I*n^4 - 18*I*n^3 - 33*I*n^2 - 18*I*n)*cos(2*f*x + 2*e) + 3*(n^4 +
 6*n^3 + 11*n^2 + 6*n)*sin(2*f*x + 2*e) - 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e)
 + 1)^(1/2*n))*f)

________________________________________________________________________________________

mupad [B]  time = 13.88, size = 323, normalized size = 2.14 \[ -\frac {{\left (c+\frac {c\,\left ({\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )\,1{}\mathrm {i}}{{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1}\right )}^n\,\left (\frac {8\,a^3\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {4\,a^3\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,\left (n^2+5\,n+6\right )\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {4\,a^3\,{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}\,\left (A-B\,1{}\mathrm {i}\right )\,\left (n^3+6\,n^2+11\,n+6\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {8\,a^3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,\left (n+3\right )\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}\right )}{3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}+{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3*(c - c*tan(e + f*x)*1i)^n,x)

[Out]

-((c + (c*(exp(e*2i + f*x*2i)*1i - 1i)*1i)/(exp(e*2i + f*x*2i) + 1))^n*((8*a^3*(3*A - B*3i + A*n + B*n*1i))/(f
*n*(n*11i + n^2*6i + n^3*1i + 6i)) + (4*a^3*exp(e*4i + f*x*4i)*(5*n + n^2 + 6)*(3*A - B*3i + A*n + B*n*1i))/(f
*n*(n*11i + n^2*6i + n^3*1i + 6i)) + (4*a^3*exp(e*6i + f*x*6i)*(A - B*1i)*(11*n + 6*n^2 + n^3 + 6))/(f*n*(n*11
i + n^2*6i + n^3*1i + 6i)) + (8*a^3*exp(e*2i + f*x*2i)*(n + 3)*(3*A - B*3i + A*n + B*n*1i))/(f*n*(n*11i + n^2*
6i + n^3*1i + 6i))))/(3*exp(e*2i + f*x*2i) + 3*exp(e*4i + f*x*4i) + exp(e*6i + f*x*6i) + 1)

________________________________________________________________________________________

sympy [A]  time = 13.12, size = 3669, normalized size = 24.30 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**n,x)

[Out]

Piecewise((x*(A + B*tan(e))*(I*a*tan(e) + a)**3*(-I*c*tan(e) + c)**n, Eq(f, 0)), (6*I*A*a**3*tan(e + f*x)**2/(
6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) - 2*I*A*a**3/(6*
I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) - 6*B*a**3*f*x*tan
(e + f*x)**3/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) -
18*I*B*a**3*f*x*tan(e + f*x)**2/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e +
f*x) + 6*c**3*f) + 18*B*a**3*f*x*tan(e + f*x)/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c
**3*f*tan(e + f*x) + 6*c**3*f) + 6*I*B*a**3*f*x/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I
*c**3*f*tan(e + f*x) + 6*c**3*f) - 3*I*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**3/(6*I*c**3*f*tan(e + f*x
)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) + 9*B*a**3*log(tan(e + f*x)**2 + 1)*ta
n(e + f*x)**2/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) +
 9*I*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18
*I*c**3*f*tan(e + f*x) + 6*c**3*f) - 3*B*a**3*log(tan(e + f*x)**2 + 1)/(6*I*c**3*f*tan(e + f*x)**3 - 18*c**3*f
*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) + 30*B*a**3*tan(e + f*x)**2/(6*I*c**3*f*tan(e + f*x)**
3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) + 36*I*B*a**3*tan(e + f*x)/(6*I*c**3*f*ta
n(e + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f) - 14*B*a**3/(6*I*c**3*f*tan(e
 + f*x)**3 - 18*c**3*f*tan(e + f*x)**2 - 18*I*c**3*f*tan(e + f*x) + 6*c**3*f), Eq(n, -3)), (2*A*a**3*f*x*tan(e
 + f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 4*I*A*a**3*f*x*tan(e + f*x)/(2*c*
*2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 2*A*a**3*f*x/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2
*f*tan(e + f*x) - 2*c**2*f) + I*A*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*
I*c**2*f*tan(e + f*x) - 2*c**2*f) - 2*A*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 +
 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - I*A*a**3*log(tan(e + f*x)**2 + 1)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*
f*tan(e + f*x) - 2*c**2*f) - 8*A*a**3*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**
2*f) - 4*I*A*a**3/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 10*I*B*a**3*f*x*tan(e + f*
x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 20*B*a**3*f*x*tan(e + f*x)/(2*c**2*f*t
an(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 10*I*B*a**3*f*x/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*
tan(e + f*x) - 2*c**2*f) + 5*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c
**2*f*tan(e + f*x) - 2*c**2*f) + 10*I*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 +
 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 5*B*a**3*log(tan(e + f*x)**2 + 1)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*
f*tan(e + f*x) - 2*c**2*f) + 2*I*B*a**3*tan(e + f*x)**3/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) -
2*c**2*f) + 22*I*B*a**3*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 16*B*a*
*3/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f), Eq(n, -2)), (8*I*A*a**3*f*x*tan(e + f*x)/(
-2*I*c*f*tan(e + f*x) + 2*c*f) - 8*A*a**3*f*x/(-2*I*c*f*tan(e + f*x) + 2*c*f) - 4*A*a**3*log(tan(e + f*x)**2 +
 1)*tan(e + f*x)/(-2*I*c*f*tan(e + f*x) + 2*c*f) - 4*I*A*a**3*log(tan(e + f*x)**2 + 1)/(-2*I*c*f*tan(e + f*x)
+ 2*c*f) - 2*I*A*a**3*tan(e + f*x)**2/(-2*I*c*f*tan(e + f*x) + 2*c*f) - 10*I*A*a**3/(-2*I*c*f*tan(e + f*x) + 2
*c*f) + 16*B*a**3*f*x*tan(e + f*x)/(-2*I*c*f*tan(e + f*x) + 2*c*f) + 16*I*B*a**3*f*x/(-2*I*c*f*tan(e + f*x) +
2*c*f) + 8*I*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-2*I*c*f*tan(e + f*x) + 2*c*f) - 8*B*a**3*log(tan(e
 + f*x)**2 + 1)/(-2*I*c*f*tan(e + f*x) + 2*c*f) - I*B*a**3*tan(e + f*x)**3/(-2*I*c*f*tan(e + f*x) + 2*c*f) - 7
*B*a**3*tan(e + f*x)**2/(-2*I*c*f*tan(e + f*x) + 2*c*f) - 16*B*a**3/(-2*I*c*f*tan(e + f*x) + 2*c*f), Eq(n, -1)
), (4*A*a**3*x + 2*I*A*a**3*log(tan(e + f*x)**2 + 1)/f - I*A*a**3*tan(e + f*x)**2/(2*f) - 3*A*a**3*tan(e + f*x
)/f - 4*I*B*a**3*x + 2*B*a**3*log(tan(e + f*x)**2 + 1)/f - I*B*a**3*tan(e + f*x)**3/(3*f) - 3*B*a**3*tan(e + f
*x)**2/(2*f) + 4*I*B*a**3*tan(e + f*x)/f, Eq(n, 0)), (-I*A*a**3*n**3*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)**
2/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 2*A*a**3*n**3*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n**4 + 6*
f*n**3 + 11*f*n**2 + 6*f*n) + I*A*a**3*n**3*(-I*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n)
 - 4*I*A*a**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)**2/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 12*A*a
**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 8*I*A*a**3*n**2*(-I
*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 3*I*A*a**3*n*(-I*c*tan(e + f*x) + c)**n*tan(
e + f*x)**2/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 18*A*a**3*n*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n
**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 23*I*A*a**3*n*(-I*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2
+ 6*f*n) + 24*I*A*a**3*(-I*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - I*B*a**3*n**3*(-I*
c*tan(e + f*x) + c)**n*tan(e + f*x)**3/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 2*B*a**3*n**3*(-I*c*tan(e + f
*x) + c)**n*tan(e + f*x)**2/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + I*B*a**3*n**3*(-I*c*tan(e + f*x) + c)**n
*tan(e + f*x)/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 3*I*B*a**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x
)**3/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 11*B*a**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)**2/(f*n*
*4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 9*I*B*a**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n**4 + 6*f*n**
3 + 11*f*n**2 + 6*f*n) + B*a**3*n**2*(-I*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 2*I*
B*a**3*n*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)**3/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 9*B*a**3*n*(-I*c
*tan(e + f*x) + c)**n*tan(e + f*x)**2/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 24*I*B*a**3*n*(-I*c*tan(e + f*
x) + c)**n*tan(e + f*x)/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 9*B*a**3*n*(-I*c*tan(e + f*x) + c)**n/(f*n**
4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 24*B*a**3*(-I*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*
n), True))

________________________________________________________________________________________